package com.ruoyi.crm.controller;

import com.ruoyi.common.annotation.MongoLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.crm.domain.vo.ClueTrackVo;
import com.ruoyi.crm.service.IClueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/clue/log")
public class ClueLogControlle extends BaseController {
    @Autowired
    private IClueService iClueService;

    @PreAuthorize("@ss.hasPermi('crm:clue:query')")
    @MongoLog(tableName = MongoLog.TableName.CLUE,title = "线索跟进记录",businessType = BusinessType.INSERT)
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") ClueTrackVo clueTrackVo)
    {
        clueTrackVo.setStatus("0");
        return success(iClueService.updateClue(clueTrackVo));
    }

}
